<!DOCTYPE html>
<html lang="zh-cn">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>使用Clojure开发Web入门系列（二） - (power up)</title>
  <meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">


<meta name="author" content="Kevin Jiang" /><meta name="description" content="开发web应用当然少不了web服务器了，咱们这里使用是的ring这个库。 零、添加依赖 打开根目录下的project.clj，找到:depend" /><meta name="keywords" content="KevinJiang, AI大模型, AI落地, 全栈工程师, Java, Spring Boot" />






<meta name="generator" content="Hugo 0.84.4 with theme even" />


<link rel="canonical" href="http://kevinjiang.info/post/clojure/%E4%BD%BF%E7%94%A8clojure%E5%BC%80%E5%8F%91web%E5%85%A5%E9%97%A8%E7%B3%BB%E5%88%97%E4%BA%8C/" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">



<link href="/sass/main.min.78f8f17bab244b9ee62ad16480c9584d5fc2db06ae20681d1ca225cefd80767c.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.css" integrity="sha256-7TyXnr2YU040zfSP+rEcz29ggW4j56/ujTPwjMzyqFY=" crossorigin="anonymous">


<meta property="og:title" content="使用Clojure开发Web入门系列（二）" />
<meta property="og:description" content="开发web应用当然少不了web服务器了，咱们这里使用是的ring这个库。 零、添加依赖 打开根目录下的project.clj，找到:depend" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://kevinjiang.info/post/clojure/%E4%BD%BF%E7%94%A8clojure%E5%BC%80%E5%8F%91web%E5%85%A5%E9%97%A8%E7%B3%BB%E5%88%97%E4%BA%8C/" /><meta property="article:section" content="post" />
<meta property="article:published_time" content="2016-03-08T21:17:10+00:00" />
<meta property="article:modified_time" content="2016-03-08T21:17:10+00:00" />

<meta itemprop="name" content="使用Clojure开发Web入门系列（二）">
<meta itemprop="description" content="开发web应用当然少不了web服务器了，咱们这里使用是的ring这个库。 零、添加依赖 打开根目录下的project.clj，找到:depend"><meta itemprop="datePublished" content="2016-03-08T21:17:10+00:00" />
<meta itemprop="dateModified" content="2016-03-08T21:17:10+00:00" />
<meta itemprop="wordCount" content="1724">
<meta itemprop="keywords" content="Clojure,Web," /><meta name="twitter:card" content="summary"/>
<meta name="twitter:title" content="使用Clojure开发Web入门系列（二）"/>
<meta name="twitter:description" content="开发web应用当然少不了web服务器了，咱们这里使用是的ring这个库。 零、添加依赖 打开根目录下的project.clj，找到:depend"/>

<!--[if lte IE 9]>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js"></script>
<![endif]-->

<!--[if lt IE 9]>
  <script src="https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js"></script>
<![endif]-->

</head>
<body>
  <div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/" class="logo">(Power up)</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>
<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    <a href="/">
        <li class="mobile-menu-item">首页</li>
      </a><a href="/post/">
        <li class="mobile-menu-item">归档</li>
      </a><a href="/tags/">
        <li class="mobile-menu-item">标签</li>
      </a><a href="/categories/">
        <li class="mobile-menu-item">分类</li>
      </a><a href="/resume/">
        <li class="mobile-menu-item">简历</li>
      </a>
  </ul>

  


</nav>

  <div class="container" id="mobile-panel">
    <header id="header" class="header">
        <div class="logo-wrapper">
  <a href="/" class="logo">(Power up)</a>
</div>





<nav class="site-navbar">
  <ul id="menu" class="menu">
    <li class="menu-item">
        <a class="menu-item-link" href="/">首页</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/post/">归档</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/tags/">标签</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/categories/">分类</a>
      </li><li class="menu-item">
        <a class="menu-item-link" href="/resume/">简历</a>
      </li>
  </ul>
</nav>

    </header>

    <main id="main" class="main">
      <div class="content-wrapper">
        <div id="content" class="content">
          <article class="post">
    
    <header class="post-header">
      <h1 class="post-title">使用Clojure开发Web入门系列（二）</h1>

      <div class="post-meta">
        <span class="post-time"> 2016-03-08 </span>
        
          <span class="more-meta"> 约 1724 字 </span>
          <span class="more-meta"> 预计阅读 4 分钟 </span>
        
      </div>
    </header>

    <div class="post-toc" id="post-toc">
  <h2 class="post-toc-title">文章目录</h2>
  <div class="post-toc-content always-active">
    <nav id="TableOfContents">
  <ul>
    <li><a href="#工作原理">工作原理</a></li>
  </ul>

  <ul>
    <li><a href="#显示浏览器的user-agent">显示浏览器的User agent</a></li>
    <li><a href="#根据url上面的参数显示不同的内容">根据url上面的参数显示不同的内容</a></li>
  </ul>
</nav>
  </div>
</div>
    <div class="post-content">
      <p>开发web应用当然少不了web服务器了，咱们这里使用是的<a href="https://github.com/ring-clojure/ring"><code>ring</code></a>这个库。</p>
<h1 id="零添加依赖">零、添加依赖</h1>
<p>打开根目录下的<code>project.clj</code>，找到<code>:dependencies</code>。</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-clojure" data-lang="clojure"><span class="ss">:dependencies</span> <span class="p">[[</span><span class="nv">org.clojure/clojure</span> <span class="s">&#34;1.8.0&#34;</span><span class="p">]]</span>
</code></pre></td></tr></table>
</div>
</div><p>有可能你看到的clojure版本跟我的不太一样，在里添加(<code>ring</code>)[https://github.com/ring-clojure/ring]，添加后像下面这样</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-clojure" data-lang="clojure"><span class="ss">:dependencies</span> <span class="p">[[</span><span class="nv">org.clojure/clojure</span> <span class="s">&#34;1.8.0&#34;</span><span class="p">]</span>
               <span class="p">[</span><span class="nv">ring</span> <span class="s">&#34;1.6.3&#34;</span><span class="p">]]</span>
</code></pre></td></tr></table>
</div>
</div><p>然后在命令行运行：</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-shell" data-lang="shell">lein deps
</code></pre></td></tr></table>
</div>
</div><p><code>lein</code>底层使用的是<code>maven</code>和(<code>clojars</code>)[https://clojars.org/]，下载下来的依赖包会在你的用户目录下的<code>.m2</code>目录，下载的所有文件可以在<code>~/.m2/repository/ring/ring/1.6.3/</code>找到。如果你身在&quot;赵国&quot;，那么你家里应该常备&quot;楼梯&quot;。</p>
<!-- raw HTML omitted -->
<h1 id="一启动http-server">一、启动HTTP Server</h1>
<p>打开<code>src/learnweb/core.clj</code>，这个是在<code>project.clj</code>里面的<code>:main</code>定义的入口点：</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span><span class="lnt">5
</span><span class="lnt">6
</span><span class="lnt">7
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-clojure" data-lang="clojure"><span class="p">(</span><span class="kd">ns </span><span class="nv">learnweb.core</span>
  <span class="p">(</span><span class="ss">:gen-class</span><span class="p">))</span>

<span class="p">(</span><span class="kd">defn </span><span class="nv">-main</span>
  <span class="s">&#34;I don&#39;t do a whole lot ... yet.&#34;</span>
  <span class="p">[</span><span class="o">&amp;</span> <span class="nv">args</span><span class="p">]</span>
  <span class="p">(</span><span class="nb">println </span><span class="s">&#34;Hello, World!&#34;</span><span class="p">))</span>
</code></pre></td></tr></table>
</div>
</div><p>下面来改造一下<code>core.clj</code>文件，把需要的函数包含进代码，然后把http server跑起来，最终的代码如下：</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-clojure" data-lang="clojure"><span class="p">(</span><span class="kd">ns </span><span class="nv">learnweb.core</span>
  <span class="p">(</span><span class="ss">:require</span> <span class="p">[</span><span class="nv">ring.adapter.jetty</span> <span class="ss">:refer</span> <span class="p">[</span><span class="nv">run-jetty</span><span class="p">]])</span>  <span class="c1">;(1)</span>
  <span class="p">(</span><span class="ss">:gen-class</span><span class="p">))</span>

<span class="p">(</span><span class="kd">defn </span><span class="nv">handler</span> <span class="p">[</span><span class="nv">request</span><span class="p">]</span>
  <span class="p">{</span><span class="ss">:status</span> <span class="mi">200</span>
   <span class="ss">:headers</span> <span class="p">{</span><span class="s">&#34;Content-Type&#34;</span> <span class="s">&#34;text/html&#34;</span><span class="p">}</span>
   <span class="ss">:body</span> <span class="s">&#34;Hello World!&#34;</span><span class="p">})</span> <span class="c1">;(2)</span>

<span class="p">(</span><span class="kd">defn </span><span class="nv">-main</span>
  <span class="s">&#34;I don&#39;t do a whole lot ... yet.&#34;</span>
  <span class="p">[</span><span class="o">&amp;</span> <span class="nv">args</span><span class="p">]</span>
  <span class="p">(</span><span class="nf">run-jetty</span> <span class="nv">handler</span> <span class="p">{</span><span class="ss">:port</span> <span class="mi">3000</span><span class="p">}))</span> <span class="c1">;(3)</span>
</code></pre></td></tr></table>
</div>
</div><p>改造了三个地方(1), (2), (3)</p>
<p>(1) 添加运行http server的函数<code>run-jetty</code>，<code>run-jetty</code>函数需要另外一个函数来处理http请求，同时会把请求的参数传递给那个函数；</p>
<p>(2) 处理http的函数，这里简单的返回状态码<code>200</code>，网页的内容类型<code>text/html</code>，网页的内容<code>&quot;Hello World!&quot;</code>；</p>
<p>(3) 通过<code>run-jetty</code>函数运行http server，启动的时候指定端口为<code>3000</code>。</p>
<p>然后在命令行运行如下命令：</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-clojure" data-lang="clojure"><span class="nv">lein</span> <span class="nv">run</span>
</code></pre></td></tr></table>
</div>
</div><p>你将会看到如下的输出：</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-text" data-lang="text">2016-03-08 21:47:49.003:INFO::main: Logging initialized @1130ms
2016-03-08 21:47:49.073:INFO:oejs.Server:main: jetty-9.2.10.v20150310
2016-03-08 21:47:49.113:INFO:oejs.ServerConnector:main: Started ServerConnector@29a5f4e7{HTTP/1.1}{0.0.0.0:3000}
2016-03-08 21:47:49.114:INFO:oejs.Server:main: Started @1241ms
</code></pre></td></tr></table>
</div>
</div><p>打开浏览器，访问<a href="http://localhost:3000">http://localhost:3000</a>，你就会看到一个网页版的Hello World!</p>
<p>完整代码在我的github上面：<a href="https://github.com/kevindragon/learn-clojure-web">Learn Clojure web</a></p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-shell" data-lang="shell">git clone https://github.com/kevindragon/learn-clojure-web
git checkout 1.2
</code></pre></td></tr></table>
</div>
</div><h2 id="工作原理">工作原理</h2>
<p><code>run-jetty</code>函数在指定的端口启动一个web server，接收http request，然后把请求交给<code>handler</code>函数进行处理，上面的<code>handler</code>函数返回一个状态码200，响应头指定Content-Type为html内容，响应的内容为Hello World!</p>
<h1 id="二显示更多信息">二、显示更多信息</h1>
<h2 id="显示浏览器的user-agent">显示浏览器的User agent</h2>
<p>把<code>&quot;Hello World!&quot;</code>改成</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-clojure" data-lang="clojure"><span class="p">(</span><span class="nb">str </span><span class="s">&#34;User agent: &#34;</span> <span class="p">(</span><span class="nf">get-in</span> <span class="nv">request</span> <span class="p">[</span><span class="ss">:headers</span> <span class="s">&#34;user-agent&#34;</span><span class="p">]))</span>
</code></pre></td></tr></table>
</div>
</div><p>handler函数变成如下：</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span><span class="lnt">4
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-clojure" data-lang="clojure"><span class="p">(</span><span class="kd">defn </span><span class="nv">handler</span> <span class="p">[</span><span class="nv">request</span><span class="p">]</span>
  <span class="p">{</span><span class="ss">:status</span> <span class="mi">200</span>
   <span class="ss">:headers</span> <span class="p">{</span><span class="s">&#34;Content-Type&#34;</span> <span class="s">&#34;text/html&#34;</span><span class="p">}</span>
   <span class="ss">:body</span> <span class="p">(</span><span class="nb">str </span><span class="s">&#34;User agent: &#34;</span> <span class="p">(</span><span class="nf">get-in</span> <span class="nv">request</span> <span class="p">[</span><span class="ss">:headers</span> <span class="s">&#34;user-agent&#34;</span><span class="p">]))})</span>
</code></pre></td></tr></table>
</div>
</div><p>然后在命令行按ctrl-c终止上次的运行，再次执行<code>lein run</code>，刷新浏览器便可以看到你自己浏览器的user agent，我的浏览器显示为：</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt">1
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-fallback" data-lang="fallback">User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36
</code></pre></td></tr></table>
</div>
</div><p>你的浏览器显示可能会不一样。<code>handler</code>函数的参数为http request的内容，包括请求头信息、url、请求参数等等。这里面直接从request中取出user-agent的信息。</p>
<h2 id="根据url上面的参数显示不同的内容">根据url上面的参数显示不同的内容</h2>
<p>接下来让咱们实现网页的内容显示url上面的信息。</p>
<p>比如<code>http://localhost:3000/hello/Kevin</code>，网页显示为<code>你好Kevin</code></p>
<p>如果是<code>http://localhost:3000/hello/Kitty</code>则显示为<code>你好Kitty</code></p>
<p>如果是<code>http://localhost:3000</code>显示为Index page，其他任何情况都显示<code>Page not found</code>。</p>
<p>完整代码如下：</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre class="chroma"><code><span class="lnt"> 1
</span><span class="lnt"> 2
</span><span class="lnt"> 3
</span><span class="lnt"> 4
</span><span class="lnt"> 5
</span><span class="lnt"> 6
</span><span class="lnt"> 7
</span><span class="lnt"> 8
</span><span class="lnt"> 9
</span><span class="lnt">10
</span><span class="lnt">11
</span><span class="lnt">12
</span><span class="lnt">13
</span><span class="lnt">14
</span><span class="lnt">15
</span><span class="lnt">16
</span><span class="lnt">17
</span><span class="lnt">18
</span><span class="lnt">19
</span><span class="lnt">20
</span><span class="lnt">21
</span><span class="lnt">22
</span><span class="lnt">23
</span><span class="lnt">24
</span><span class="lnt">25
</span><span class="lnt">26
</span><span class="lnt">27
</span></code></pre></td>
<td class="lntd">
<pre class="chroma"><code class="language-clojure" data-lang="clojure"><span class="p">(</span><span class="kd">ns </span><span class="nv">learnweb.core</span>
  <span class="p">(</span><span class="ss">:require</span> <span class="p">[</span><span class="nv">ring.adapter.jetty</span> <span class="ss">:refer</span> <span class="p">[</span><span class="nv">run-jetty</span><span class="p">]]</span>
            <span class="p">[</span><span class="nv">clojure.string</span> <span class="ss">:refer</span> <span class="p">[</span><span class="nv">split</span><span class="p">]])</span>
  <span class="p">(</span><span class="ss">:gen-class</span><span class="p">))</span>

<span class="p">(</span><span class="kd">defn </span><span class="nv">uri-split</span> <span class="p">[</span><span class="nv">str</span><span class="p">]</span>
  <span class="p">(</span><span class="nb">filter </span><span class="o">#</span><span class="p">(</span><span class="nf">not-empty</span> <span class="nv">%</span><span class="p">)</span> <span class="p">(</span><span class="nf">split</span> <span class="nb">str </span><span class="o">#</span><span class="s">&#34;/&#34;</span><span class="p">)))</span>    <span class="c1">; (1)</span>

<span class="p">(</span><span class="kd">defn </span><span class="nv">route</span> <span class="p">[</span><span class="nv">request</span><span class="p">]</span>
  <span class="p">(</span><span class="k">let </span><span class="p">[</span><span class="nv">uri</span> <span class="p">(</span><span class="ss">:uri</span> <span class="nv">request</span><span class="p">)</span>
        <span class="nv">seg</span> <span class="p">(</span><span class="nf">uri-split</span> <span class="nv">uri</span><span class="p">)]</span>
    <span class="p">(</span><span class="nf">cond</span>
      <span class="p">(</span><span class="nb">= </span><span class="nv">uri</span> <span class="s">&#34;/&#34;</span><span class="p">)</span> <span class="s">&#34;Index page&#34;</span>
      <span class="p">(</span><span class="nb">= </span><span class="p">(</span><span class="nb">first </span><span class="nv">seg</span><span class="p">)</span> <span class="s">&#34;hello&#34;</span><span class="p">)</span> <span class="p">(</span><span class="nb">str </span><span class="s">&#34;你好&#34;</span> <span class="p">(</span><span class="nb">nth </span><span class="nv">seg</span> <span class="mi">1</span> <span class="s">&#34;Oops&#34;</span><span class="p">))</span>
      <span class="ss">:else</span> <span class="s">&#34;Page not found&#34;</span><span class="p">)))</span>    <span class="c1">; (2)</span>

<span class="p">(</span><span class="kd">defn </span><span class="nv">handler</span> <span class="p">[</span><span class="nv">request</span><span class="p">]</span>
  <span class="p">(</span><span class="k">let </span><span class="p">[</span><span class="nv">uri</span> <span class="p">(</span><span class="ss">:uri</span> <span class="nv">request</span><span class="p">)</span>
        <span class="nv">seg</span> <span class="p">(</span><span class="nf">uri-split</span> <span class="nv">uri</span><span class="p">)]</span>
    <span class="p">{</span><span class="ss">:status</span> <span class="mi">200</span>
     <span class="ss">:headers</span> <span class="p">{</span><span class="s">&#34;Content-Type&#34;</span> <span class="s">&#34;text/html; charset=utf-8&#34;</span><span class="p">}</span>
     <span class="ss">:body</span> <span class="p">(</span><span class="nf">route</span> <span class="nv">request</span><span class="p">)}))</span>    <span class="c1">; (3)</span>

<span class="p">(</span><span class="kd">defn </span><span class="nv">-main</span>
  <span class="s">&#34;I don&#39;t do a whole lot ... yet.&#34;</span>
  <span class="p">[</span><span class="o">&amp;</span> <span class="nv">args</span><span class="p">]</span>
  <span class="p">(</span><span class="nf">run-jetty</span> <span class="nv">handler</span> <span class="p">{</span><span class="ss">:port</span> <span class="mi">3000</span><span class="p">}))</span>
</code></pre></td></tr></table>
</div>
</div><p>(1) 添加uri-split函数，用于分割uri成列表。/hello/Kitty &ndash;&gt; [&ldquo;hello&rdquo; &ldquo;Kitty&rdquo;]</p>
<p>(2) 添加路由处理函数<code>route</code>，也就是根据uri参数把请求分发到不同的处理函数，得到uri列表后，然后使用<code>cond</code>函数做分发处理</p>
<p>(3) 在返回的内容使用路由函数处理</p>
<p>完整的<a href="https://github.com/kevindragon/learn-clojure-web">代码</a>请checkout到<code>1.2</code>分支。</p>

    </div>

    <div class="post-copyright">
  <p class="copyright-item">
    <span class="item-title">文章作者</span>
    <span class="item-content">Kevin Jiang</span>
  </p>
  <p class="copyright-item">
    <span class="item-title">上次更新</span>
    <span class="item-content">
        2016-03-08
        
    </span>
  </p>
  
  <p class="copyright-item">
    <span class="item-title">许可协议</span>
    <span class="item-content"><a rel="license noopener" href="https://creativecommons.org/licenses/by-nc-nd/4.0/" target="_blank">CC BY-NC-ND 4.0</a></span>
  </p>
</div>
<div class="post-reward">
  <input type="checkbox" name="reward" id="reward" hidden />
  <label class="reward-button" for="reward">赞赏支持</label>
  <div class="qr-code">
    
    <label class="qr-code-image" for="reward">
        <img class="image" src="/img/wechat_pay_1242x1242.jpg">
        <span>微信打赏</span>
      </label>
    <label class="qr-code-image" for="reward">
        <img class="image" src="/img/alipay_600x600.jpg">
        <span>支付宝打赏</span>
      </label>
  </div>
</div><footer class="post-footer">
      <div class="post-tags">
          <a href="/tags/clojure/">Clojure</a>
          <a href="/tags/web/">Web</a>
          </div>
      <nav class="post-nav">
        <a class="prev" href="/post/clojure/clojure%E5%BF%AB%E9%80%9F%E6%8E%92%E5%BA%8F/">
            <i class="iconfont icon-left"></i>
            <span class="prev-text nav-default">Clojure快速排序</span>
            <span class="prev-text nav-mobile">上一篇</span>
          </a>
        <a class="next" href="/post/clojure/%E4%BD%BF%E7%94%A8clojure%E5%BC%80%E5%8F%91web%E5%85%A5%E9%97%A8%E7%B3%BB%E5%88%97%E4%B8%80/">
            <span class="next-text nav-default">使用Clojure开发Web入门系列（一）</span>
            <span class="next-text nav-mobile">下一篇</span>
            <i class="iconfont icon-right"></i>
          </a>
      </nav>
    </footer>
  </article>
        </div>
        

  

  

      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="social-links">
      <a href="mailto:wenlin1988@126.com" class="iconfont icon-email" title="email"></a>
      <a href="https://www.linkedin.com/in/%E6%96%87%E6%9E%97-%E8%92%8B-0a3204126/" class="iconfont icon-linkedin" title="linkedin"></a>
      <a href="https://github.com/kevindragon" class="iconfont icon-github" title="github"></a>
  <a href="http://kevinjiang.info/index.xml" type="application/rss+xml" class="iconfont icon-rss" title="rss"></a>
</div>

<div class="copyright">
  <span class="power-by">
    由 <a class="hexo-link" href="https://gohugo.io">Hugo</a> 强力驱动
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    主题 -
    <a class="theme-link" href="https://github.com/olOwOlo/hugo-theme-even">Even</a>
  </span>

  

  <span class="copyright-year">
    &copy;
    2015 -
    2023<span class="heart"><i class="iconfont icon-heart"></i></span><span>Kevin Jiang</span>
    <a href="https://beian.miit.gov.cn/" target="_blank">湘ICP备2022022745号</a>
  </span>
</div>

    </footer>

    <div class="back-to-top" id="back-to-top">
      <i class="iconfont icon-up"></i>
    </div>
  </div>
  
  <script src="https://cdn.jsdelivr.net/npm/jquery@3.2.1/dist/jquery.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/slideout@1.0.1/dist/slideout.min.js" integrity="sha256-t+zJ/g8/KXIJMjSVQdnibt4dlaDxc9zXr/9oNPeWqdg=" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.1.20/dist/jquery.fancybox.min.js" integrity="sha256-XVLffZaxoWfGUEbdzuLi7pwaUJv1cecsQJQqGLe7axY=" crossorigin="anonymous"></script>



<script type="text/javascript" src="/js/main.min.c99b103c33d1539acf3025e1913697534542c4a5aa5af0ccc20475ed2863603b.js"></script>
  <script type="text/javascript">
    window.MathJax = {
      tex: {
        inlineMath: [['$','$'], ['\\(','\\)']],
        tags: 'ams',
        }
    };
  </script>
  <script type="text/javascript" async src="/lib/mathjax/es5/tex-mml-chtml.js"></script>

<script id="baidu_analytics">
  var _hmt = _hmt || [];
  (function() {
    if (window.location.hostname === 'localhost') return;
    var hm = document.createElement("script"); hm.async = true;
    hm.src = "https://hm.baidu.com/hm.js?b73ff6d4afc4af9e582d8a5dc068bab9";
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(hm, s);
  })();
</script>






</body>
</html>
